package com.wangjiacai.utils.utils;

import com.wangjiacai.utils.enums.ResultEnum;
import com.wangjiacai.utils.web.exception.CodeMessageException;
import com.wangjiacai.utils.web.service.RedisService;


public class SmsCodeUtil {

    public static void validCode(RedisService redisService,String phone, String code){
        String codeValid=redisService.get(phone,String.class);
        if(codeValid==null||!codeValid.equals(code)){
            throw new CodeMessageException(ResultEnum.CodeError);
        }
    }
}
